//    Copyright (C) Kherty.  All rights reserved.
using System.Collections.Generic;
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing.Diagram
{
    internal class Rules : IOfficeXmlSerializable
    {
        List<NumericRule> _rules = new List<NumericRule>();
        public void ReadXml(ReadContext context)
        {
            using (var c = context.Read("ruleLst"))
            {
                _rules.Clear();
                _rules.AddRange(c.ReadOptionalWhile<NumericRule>("rule"));
                
            }

        }

        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write("ruleLst"))
            {
                c.WriteElements(_rules);
            }
        }
    }
}